/*
 * Copyright (C) 2015 huwentao.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.mokey.core.demo;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;

import com.mokey.core.annotation.Layout;
import com.mokey.core.base.BaseActivity;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

@Layout(R.layout.activity_common)
public class CommonActivity extends BaseActivity {
    @BindView(R.id.recyclerView) RecyclerView recyclerView;
    @BindView(R2.id.toolbar) Toolbar toolbar;

    private ItemAdapter itemAdapter;
    private List<String> itemList = new ArrayList<>();

    @Override
    protected void init(Bundle savedInstanceState) {
        initToolBar(toolbar,true);
        itemList.add("");
        itemAdapter =new ItemAdapter(this,itemList);
        LinearLayoutManager manager = new LinearLayoutManager(this);
        manager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(manager);
        recyclerView.setHasFixedSize(true);
        itemAdapter.setHasStableIds(true);
        recyclerView.setAdapter(itemAdapter);
    }

}
